const path = require('path');

const webpackMerge = require('webpack-merge');
const baseConfig = require('./webpack.base.config');


var pkg = require('../package.json');
var semver = require('semver');

var version = pkg.version;

module.exports = webpackMerge(baseConfig, {
    mode: "production",
    devtool: "source-map",

    entry: './index.tsx', // 入口文件
    output: {
        path: path.resolve(__dirname, '../umd/' + version), // 定义输出目录
        filename: 'index.js'  // 定义输出文件名称
    },
    // When importing a module whose path matches one of the following, just
    // assume a corresponding global variable exists and use that instead.
    // This is important because it allows us to avoid bundling all of our
    // dependencies, which allows browsers to cache those libraries between builds.
    externals: {
        "react": "React",
        "react-dom": "ReactDOM"
    }
});